import Vue from 'vue'
import Happyupmp from './HAPPYUPMP'
import router from './router'
import Antd from 'ant-design-vue'
import store from './store'
import request from '@/utils/request'
import db from '@/utils/localstorage'
import VueApexCharts from 'vue-apexcharts'
import VueContextMenu from 'vue-contextmenu'
import vcolorpicker from 'vcolorpicker'
import BaseView from '~/common/baseView/BaseView.js'

import 'ant-design-vue/dist/antd.css'

import '@/utils/install'

/**
 * formMaking 相关开始
 */
// ElementUI
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

// formMaking
import FormMaking from './components/formMaking/index'
import FullLinkResult from './views/workflow/formConfig/FullLinkResult'
import FullLinkAmt from './views/workflow/formConfig/FullLinkAmt'
import FullLinkSeq from './views/workflow/formConfig/FullLinkSeq'
import VueEditor from 'vue2-editor'
//import BaseView from '~/common/baseView/BaseView.js'

import moment from 'moment'
import 'moment/locale/zh-cn'

import * as echarts from 'echarts'
moment.locale('zh-cn')
//Vue.use(BaseView)
Vue.prototype.$echarts = echarts
Vue.prototype.$moment = moment
/**
 * formMaking 相关结束
 */
import JsonViewer from 'vue-json-viewer'

Vue.use(ElementUI)
Vue.use(FormMaking, {
  components: [{
    name: 'full-link-result',
    component: FullLinkResult // 自定义组件
  },{
    name: 'full-link-amt',
    component: FullLinkAmt // 自定义组件
  },{
    name: 'full-link-seq',
    component: FullLinkSeq // 自定义组件
  }]
})

Vue.config.productionTip = false
Vue.use(Antd)
Vue.use(db)
Vue.use(VueEditor)
Vue.use(VueApexCharts)
Vue.use(JsonViewer)
Vue.use(VueContextMenu)
Vue.use(vcolorpicker)
Vue.use(BaseView)

Vue.component('apexchart', VueApexCharts)

Vue.use({
  install (Vue) {
    Vue.prototype.$db = db
  }
})

Vue.prototype.$post = request.post
Vue.prototype.$postJson = request.postJson
Vue.prototype.$get = request.get
Vue.prototype.$put = request.put
Vue.prototype.$delete = request.delete
Vue.prototype.$export = request.export
Vue.prototype.$download = request.download
Vue.prototype.$upload = request.upload
Vue.prototype.$send = request.send

/* eslint-disable no-new */
new Vue({
  router,
  store,
  render: h => h(Happyupmp)
}).$mount('#upmp')
